<!DOCTYPE html>
<html>
<head>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>
    <title><?php if($info['types']==1){echo '车找货';}else{echo '货找车';}?> {$info.gotime|date='m-d H:i',###}
        从{$info.from}到{$info.to} <?php $settings = get_addon_settings();echo $settings['title'];?></title>
    <link href="__ROOT__/Addons/pinche/View/Public/css/base.css" rel="stylesheet"/>
    <link href="__ROOT__/Addons/pinche/View/Public/css/pinche/base.css" rel="stylesheet"/>
    <link href="__ROOT__/Addons/pinche/View/Public/css/animate.min.css" rel="stylesheet"/>
    <script src="__ROOT__/Addons/pinche/View/Public/js/jquery.js"></script>
    <script src="__ROOT__/Addons/pinche/View/Public/js/base.js"></script>
    <link href="__ROOT__/Addons/pinche/View/Public/css/pinche/detail.css?v=9" rel="stylesheet"/>
    <style>
        /*base.css*/
        @font-face {
            font-family: 'iconfont';
            src: url('__ROOT__/Addons/pinche/View/Public/font/iconfont.eot'); /* IE9*/
            src: url('__ROOT__/Addons/pinche/View/Public/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('__ROOT__/Addons/pinche/View/Public/font/iconfont.woff?v=5') format('woff'), /* chrome、firefox */ url('__ROOT__/Addons/pinche/View/Public/font/iconfont.ttf?v=5') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('__ROOT__/Addons/pinche/View/Public/font/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
        }

        .iconfont {
            font-family: "iconfont" !important;
            font-size: 16px;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
        }

        @font-face {
            font-family: 'sysiconfont';
            src: url('/images/sysiconfont/iconfont.eot?v=6'); /* IE9*/
            src: url('/images/sysiconfont/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('/images/sysiconfont/iconfont.woff?v=6') format('woff'), /* chrome、firefox */ url('/images/sysiconfont/iconfont.ttf?v=6') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('/images/sysiconfont/iconfont.svg#sysiconfont') format('svg'); /* iOS 4.1- */
        }

        .sysiconfont {
            font-family: "sysiconfont" !important;
            font-size: 16px;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
        }

        .list .over {
            width: 80px;
            height: 50px;
            position: absolute;
            bottom: 50px;
            right: 80px;
            background: url(__ROOT__/Addons/pinche/View/Public/images/over.png) no-repeat;
            background-size: 100% auto;
        }

        body {
            background: url(__ROOT__/Addons/pinche/View/Public/images/bg.jpg) repeat-y;
            background-size: 100% auto;
            padding-bottom: 50px
        }

        .tel {
            padding-top: 10px;
        }

        .tel a {
            background: #e33737;
            color: #fff;
            height: 40px;
            line-height: 40px;
            display: block;
            text-align: center;
            border-radius: 20px
        }

        .over {
            width: 100px;
            height: 70px;
            position: absolute;
            top: 170px;
            right: 50%;
            margin-right: -50px;
            background: url(__ROOT__/Addons/pinche/View/Public/images/over.png) no-repeat;
            background-size: 100% auto;
        }

        .re {
            height: auto;
            overflow: hidden;
            line-height: 1.7em;
            padding: 4px 0
        }

        .admin {
            position: absolute;
            top: 10px;
            right: 10px;
        }

        .admin a {
            background: #515151;
            color: #fff;
            font-size: 12px;
            padding: 2px 5px;
            margin-left: 5px;
            border-radius: 5px
        }
        .admin a.guan{
            padding:4px 7px;
            font-weight: normal;
            background:#04be02;
        }
        .admin a.unguan{
            padding:4px 7px;
            font-weight: normal;
            background:pink;
        }
        .row{
                height:auto !important;
            }
    </style>

    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">
        wx.config({
            debug: false,
            appId: '<?=$config['appId']?>',
            timestamp: <?=$config['timestamp']?>,
                nonceStr: '<?=$config['nonceStr']?>',
                signature: '<?=$config['signature']?>',
                jsApiList: ['checkJsApi', 'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone',
            'getLocation']
        });

        wx.ready(function () {
            wx.onMenuShareTimeline({
                title: '{$system_settings['site_name']}-<?php if($info['types']==1){echo '车找货';}else{echo '货找车';}?> {$info.gotime|date='m-d H:i',###}(从{$info.from}到{$info.to})', // 分享标题
                link: '<?=$config['url']?>', // 分享链接
                imgUrl: '<?=$addon_config['share_pic']?>'
            });

            wx.onMenuShareAppMessage({
                title: '<?php if($info['types']==1){echo '车找货';}else{echo '货找车';}?> (从{$info.from}到{$info.to})', // 分享标题
                desc: '出发时间{$info.gotime|date='m-d H:i',###} <?php if($info['people_count']==0){echo $info['num'].'件';
            }else{
                echo $info['people_count'].'个座位';
            }?>', // 分享描述
                link: '<?=$config['url']?>', // 分享链接
                imgUrl: '<?=$addon_config['share_pic']?>', // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

        })

        function del(id) {
            $.confirm('确定删除？', "", function () {
                $.getJSON("{:create_addon_url('del')}/id/" + id, function (data) {
                    if (data.status) {
                        $.toast("删除成功", "ok");
                        setTimeout(function () {
                            window.location.href = "{:create_addon_url('index')}";
                        }, 1000);
                    }
                    else
                        $.toast("删除失败");
                });
            })
        }

        function toggle(id,type){
            $.ajax({
                type: 'GET',
                url:"{:create_mobile_url('toggle')}&id="+id+"&type="+type,
                dataType: 'json',
                success: function(data){
                   if(data.status){
                        $.toast(data.info, "ok");
                        if($('#guanzhu').attr('class') == 'guan'){
                            $('#guanzhu').attr('class','unguan');
                            $('#guanzhu').text('关注');
                        }else{
                            $('#guanzhu').attr('class','guan');
                            $('#guanzhu').text('已关注');  
                        }
                   }else{
                        $.toast(data.info);
                        if(data.url){
                            setTimeout(function () {
                            window.location.href = data.url;
                            }, 1000);
                        }
                   }
                },
                error: function(xhr, type){
                    $.toast("重新尝试");
                }
            });
        }
    </script>


</head>
<body id="detail">

<div class="header100">
    <a href="javascript:;" onclick="history.back(-1)" class="a back"><i class="iconfont">&#xe60b;</i></a>
    <div class="txt">详情</div>
</div>

<div class="wrap" id="main">

    <div class="wr">
        <div class="box ">
            <div class="user">
                <img src="{$info.UserFace}"/>
                <em>{$info.nickname}({$info.contact})
                    <?php
                    if($info['Sex']==1){
                    ?>
                    <i class='iconfont'>&#xe617;</i>
                    <?php
                    }else{
                    ?>
                    <i class="iconfont girl">&#xe616;</i>
                    <?php
                    }
                    ?>

                </em>
            </div>
            <div class="row"><span>类型</span>
                <?php
            if($info['types']==1){
            echo '车找货';
            }else{
            echo '货找车';
            }
            ?>
            </div>
            <div class="row"><span>出发</span>{$info.gotime|date='Y-m-d H:i:s',###}</div>
            <div class="row"><span>从</span>{$info.from}</div>
            <div class="row"><span>到</span>{$info.to}</div>

            <div class="row"><span>费用</span><?php
                if($info['money']==0.00){
                echo '面议';
                }else{
                echo ceil($info['money']);
                }
                ?>
            </div>
            <div class="row"><span>
                <?php
                if($info['people_count']==0){
                ?>
                数量</span><?php echo $info['num'];?>件
                <?php
                }else{
                ?>
                数量</span><?php echo $info['people_count'];?>件
                <?php
                }
                ?>
            </div>

            <?php
            if(!empty($info['CarType'])){
            ?>
            <div class="row"><span>车型</span><?php echo $info['CarType']?></div>
            <?php
            }
            ?>

            <div class="row"><span>发布</span>{$info.pubtime|date='Y-m-d H:i:s',###}</div>
            <div class="row"><span>备注</span>{$info.remark}</div>
            <div class="row"><span>途径</span>{$info.through}</div>
            <div class="row tel">
                <a href="tel:{$info.tel}">电话联系</a>
            </div>
    
           <!--  <div class="<?php
            if($info['gotime'] < time()){
            echo 'over';
            }
            ?>"></div> -->
            <div class="admin">
            <?php
            if($info['openid']==$user_openid){
            ?>
            
                <a href="{:create_mobile_url("update",array('id'=>$id))}" >编辑</a>
            <?php
            }else{
              $status = M('BsGuanzhu')->where(array('mpid'=>get_mpid(),'openid'=>get_openid(),'did'=>$id,'type'=>'pin'))->getField('status');
              if($status){
            ?>
            <a href="javascript:;" onclick="toggle(<?=$id?>,'pin')"  class="guan" id="guanzhu">已关注</a>
            <?php
              }else{
            ?>
            <a href="javascript:;" onclick="toggle(<?=$id?>,'pin')" class="unguan" id="guanzhu">关注</a>
            <?php
              }
            ?>
            
            
            <?php 
            }
            ?>
             </div>
        </div>
    </div>

</div>
<div class="footer">
<!-- <a href="http://kuhou.net/">酷猴</a>提供技术支持 -->
&copy;华厨网
</div>

<div id="b-menu" class="animated fadeInUp">
    <a href="{:create_addon_url('index')}/mpid/<?php echo get_mpid()?>" style="width: 33%"><i class="iconfont">
        &#xe61b;</i>首页</a>
    <a href="{:create_addon_url('add')}/mpid/<?php echo get_mpid()?>" style="width: 34%" class="sel"><i
            class="iconfont">&#xe61a;</i>发布</a>
    <a href="{:create_addon_url('user')}/mpid/<?php echo get_mpid()?>" style="width: 33%"><i class="iconfont">
        &#xe61d;</i>我的</a>
</div>

</body>
</html>